import { Base } from "../../utils/base.js"

class ProductList extends Base {
  constructor() {
    super();
  }

  //商品信息
  getProductData(page,sort,params,callback) {
    var params = {
      url: 'product/index?page=' + page + '&sort=' + sort,
      data: params,
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    }
    this.request(params);
  }
  //秒杀商品信息
  getPromProductData(page,num,params,callback) {
    var params = {
      url: 'promotion/flash-sale?expand=product,skus&page='+page+'&num='+num,
      data:params,
      type:'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    }
    this.request(params);
  }
};

export { ProductList };